﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace MineSweeperCheater.Test
{
  [TestFixture]
  class TestDetermineMineFieldDimensions
  {
    [Test]
    public void WithEmptyStringField()
    {
      var input = new string[0];
      var result = Cheater.DetermineMineFieldDimensions(input);
      var expected = new Cheater.FieldDimensions() { Rows = 0, Cols = 0 };
      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void WithNullStrings()
    {
      var input = new string[2];
      var result = Cheater.DetermineMineFieldDimensions(input);
      var expected = new Cheater.FieldDimensions() { Rows = 2, Cols = 0 };
      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void With2Rows4Cols()
    {
      var input = new string[] { "1234", "5678"};
      var result = Cheater.DetermineMineFieldDimensions(input);
      var expected = new Cheater.FieldDimensions() { Rows = 2, Cols = 4 };
      Assert.That(result, Is.EqualTo(expected));
    }

  }
}
